package cz.gillan.housecosts;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class Main extends Activity {
	private Button testButton;
	private Button testButton2;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        initialize();
    }
    
    private void initialize() {
    	testButton = (Button)findViewById(R.id.testButton1);
        testButton.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View view) {
				launchGaugeEdit(view);
			}
		});
        
        testButton2 = (Button)findViewById(R.id.testButton2);
        testButton2.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View view) {
				launchGaugeList(view);
			}
		});
    }
    
    private void launchGaugeEdit(View view) {
//    	Context ctx = view.getContext();
//    	Intent i = new Intent(ctx, GaugeEditActivity.class);
//    	startActivityForResult(i, 0);
    }
    
    private void launchGaugeList(View view) {
    	Intent i = new Intent(view.getContext(), GaugesActivity.class);
    	startActivityForResult(i, 2);
    }
    
    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
    	Toast.makeText(getApplicationContext(), "Back " + requestCode + " - " + resultCode, Toast.LENGTH_SHORT).show();
    }
}